package com.hbnu.Service.Impl;

import com.hbnu.Dao.DormManagerDao;
import com.hbnu.Dao.Impl.DormManagerDaoImp;
import com.hbnu.Dao.Impl.UserDaoImpl;
import com.hbnu.Dao.UserDao;
import com.hbnu.Pojo.DormBuild;
import com.hbnu.Service.DormManagerService;

import java.util.Collections;
import java.util.List;

public class DormManagerServiceImp implements DormManagerService {

    private DormManagerDao dormManagerDao = new DormManagerDaoImp();

    @Override
    public List<DormBuild> findBuilds() {
        List<DormBuild> dormBuilds= dormManagerDao.findDorm();
        return dormBuilds;
    }

    @Override
    public void deleteByUserId(int id) {
        dormManagerDao.deleteByUserId(id);
    }

    @Override
    public void savaManagerAndBuild(int id, String[] dormId) {
        dormManagerDao.savaManagerAndBuild(id, dormId);
    }

    @Override
    public List<DormBuild> findByUserId(Integer id) {
        return dormManagerDao.findByUserId(id);
    }

    @Override
    public List<DormBuild> findAll() {
        return dormManagerDao.findAll();
    }


}
